package com.blqy.fr.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.blqy.fr.model.user.Team;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TeamInfoMapper extends BaseMapper<Team> {

    @Select("SELECT t.* FROM team t " +
            "INNER JOIN team_user tu ON t.id = tu.team_id " +
            "WHERE tu.user_id = #{userId}")
    List<Team> selectTeamsByUserId(Long userId);
}
